//
//  StrategyModel.m
//  B项目
//
//  Created by lanou on 15/12/17.
//  Copyright © 2015年 tzf. All rights reserved.
//

#import "StrategyModel.h"

@implementation StrategyModel

-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"id"]) {
        self.ID = value;
    }
}







//@property (nonatomic, copy) NSString *group_id;
//@property (nonatomic, copy) NSString *icon_url;
//@property (nonatomic, copy) NSString *ID;
//@property (nonatomic, copy) NSString *items_count;
//@property (nonatomic, copy) NSString *name;
//@property (nonatomic, copy) NSString *order;
//@property (nonatomic, copy) NSString *status;
//@property (nonatomic, retain) UIImage *imageIcon;



- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:_group_id forKey:@"title"];
    [aCoder encodeObject:_icon_url forKey:@"begin_time"];
    [aCoder encodeObject:_ID forKey:@"end_time"];
    [aCoder encodeObject:_items_count forKey:@"address"];
    [aCoder encodeObject:_name forKey:@"category_name"];
    [aCoder encodeObject:_order forKey:@"participant_count"];
    [aCoder encodeObject:_status forKey:@"wisher_count"];
    
    
    [aCoder encodeDataObject:UIImagePNGRepresentation(_imageIcon)];
}



- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        self.group_id = [aDecoder decodeObjectForKey:@"title"];
        self.icon_url = [aDecoder decodeObjectForKey:@"begin_time"];
        self.ID = [aDecoder decodeObjectForKey:@"end_time"];
        self.items_count = [aDecoder decodeObjectForKey:@"address"];
        self.name = [aDecoder decodeObjectForKey:@"category_name"];
        self.order = [aDecoder decodeObjectForKey:@"participant_count"];
        self.status = [aDecoder decodeObjectForKey:@"wisher_count"];
        
        self.imageIcon= [UIImage imageWithData:[aDecoder decodeDataObject]];
    }
    return self;
}














@end
